package com.cg.managesystem.controller;

import com.cg.managesystem.common.JSONResult;
import com.cg.managesystem.entity.Post;
import com.cg.managesystem.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * Created on 2019/8/14 by Tinchi
 **/

@RestController
@RequestMapping(value = "/manage")
public class PostController {

    @Autowired
    private PostService postService;

    /**
     *  搜索所有帖子
     * @return  AllPosts
     */
    @PostMapping(value = "/findAllPosts")
    public List<Post> findAllPosts(){
        return postService.findAllPosts();
    }


}
